home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Developer Helper 1: Phil & Dave's Excellent CD
/
Excellent CD HFS.raw
/
Moof
/
Goodies
/
MPW Goodies
/
MPW Goodies⁄DTS
/
Wild
< prev
Wrap
Text File
|
1989-04-13
|
864b
|
40 lines
# Wild - single wild card command interpreter
#
# Command line: Wild command source destination
# Example: Wild Rename =.TEXT =
#
# Parameters:
# {1} = command
# {2} = srcfilespec
# {3} = destfilespec
If {#} < 3
Echo "# {0} - Not enough parameters were specified."
Exit
End
If {#} > 3
Echo "# {0} - Too many parameters were specified."
Exit
End
If "{2}" !~ /≈=≈/
Echo "# {0} - No = was specified in the source file name."
Exit
End
If "{3}" !~ /≈=≈/
Echo "# {0} - No = was specified in the destination file name."
Exit
End
( Evaluate "{2}" =~ /(≈)®1=(≈)®2/ ) > dev:null
Set sourcePre "{®1}"
Set sourcePost "{®2}"
( Evaluate "{3}" =~ /(≈)®1=(≈)®2/ ) > dev:null
Set destPre "{®1}"
Set destPost "{®2}"
For name In "{sourcePre}"≈"{sourcePost}"
( Evaluate "{name}" =~ /{sourcePre}(≈)®1{sourcePost}/ ) > dev:null
{1} "{name}" "{destPre}{®1}{destPost}"
End